package net.guerlab.smart.wx.core.searchparams;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import net.guerlab.spring.searchparams.AbstractSearchParams;
import net.guerlab.spring.searchparams.OrderByType;
import net.guerlab.spring.searchparams.SearchModel;
import net.guerlab.spring.searchparams.SearchModelType;

import javax.persistence.Column;
import java.time.LocalDateTime;

/**
 * 微信用户登录记录搜索参数
 *
 * @author guer
 */
@Setter
@Getter
@ApiModel("微信用户登录记录搜索参数")
public class WxUserLoginLogSearchParams extends AbstractSearchParams {

    /**
     * 登录记录ID
     */
    @ApiModelProperty("登录记录ID")
    private Long loginLogId;

    /**
     * openId
     */
    @ApiModelProperty("openId")
    private String openId;

    /**
     * 应用ID
     */
    @ApiModelProperty("应用ID")
    private String appId;

    /**
     * unionId
     */
    @ApiModelProperty("unionId")
    private String unionId;

    /**
     * 昵称
     */
    @ApiModelProperty("昵称")
    @Column(name = "nickName")
    @SearchModel(SearchModelType.LIKE)
    private String nickNameLike;

    /**
     * 登录时间开始范围
     */
    @ApiModelProperty("登录时间开始范围")
    @Column(name = "loginTime")
    @SearchModel(SearchModelType.GREATER_THAN_OR_EQUAL_TO)
    private LocalDateTime loginTimeStartWith;

    /**
     * 登录时间结束范围
     */
    @ApiModelProperty("登录时间结束范围")
    @Column(name = "loginTime")
    @SearchModel(SearchModelType.LESS_THAN_OR_EQUAL_TO)
    private LocalDateTime loginTimeEndWith;

    /**
     * 账号是否已激活
     */
    @ApiModelProperty("账号是否已激活")
    private Boolean activated;

    /**
     * 登录IP
     */
    @ApiModelProperty("登录IP")
    private String ip;

    /**
     * 登录源关键字
     */
    @ApiModelProperty("登录源关键字")
    @Column(name = "referer")
    @SearchModel(SearchModelType.LIKE)
    private String refererLike;

    /**
     * 登录时间排序方式
     */
    @ApiModelProperty(hidden = true)
    @Column(name = "loginTime")
    @JsonIgnore
    private OrderByType loginTimeOrderByType = OrderByType.DESC;
}
